////////////////////////////////////////
//	File Header
//	Author: Stephen Ringer | stephen.ringer@gmail.com
//	File: SAGAAudioDevice.h
//
////////////////////////////////////////
#pragma once
////////////////////////////////////////
//	File Includes
#include <windows.h>
#include <stdio.h>
#include "../SAGAD3D/SAGA.h"
//
////////////////////////////////////////

////////////////////////////////////////
//	Class Name: SAGAAudioDevice
class SAGAAudioDevice 
{
protected:
	HWND       m_hWndMain;          // application main window
	HINSTANCE  m_hDLL;              // dll module handle
	bool       m_bRunning;          // after succesful initialization
	FILE      *m_pLog;              // log file
  
  
public:
	SAGAAudioDevice(void) {};
	virtual ~SAGAAudioDevice(void) {};


	// INIT/RELEASE STUFF:
	// ===================

	virtual HRESULT Init(HWND, const char*, bool)=0;

	// release API specific stuff
	virtual void Release()=0;

	// is initialized?
	virtual bool IsRunning()=0;

	// stop all audio at once
	virtual void StopAll()=0;

	// load WAV from file
	virtual HRESULT LoadSound(const char*, UINT*)=0;

	// play a specific sound
	virtual void PlaySound(UINT, bool bLoop)=0;

	// stop a specific sound
	virtual void StopSound(UINT)=0;

	// set listener parameters
	virtual void SetListener(SAGAVector vPos, SAGAVector vDir, 
						   SAGAVector vUp,  SAGAVector vV)=0;

	// set sound parameters
	virtual void SetSoundPosition(SAGAVector, UINT)=0;
	virtual void SetSoundDirection(SAGAVector, SAGAVector vV, UINT)=0;
	virtual void SetSoundMaxDist(float, UINT)=0;
};
typedef class SAGAAudioDevice *LPSAGAAUDIODEVICE;
//
////////////////////////////////////////

////////////////////////////////////////
//	External DLL Functions
extern "C" 
{
	HRESULT CreateAudioDevice(HINSTANCE hDLL, SAGAAudioDevice **pInterface);
	typedef HRESULT (*CREATEAUDIODEVICE)(HINSTANCE hDLL, SAGAAudioDevice **pInterface);

	HRESULT ReleaseAudioDevice(SAGAAudioDevice **pInterface);
	typedef HRESULT (*RELEASEAUDIODEVICE)(SAGAAudioDevice **pInterface);
}
//
////////////////////////////////////////